package com.stars.services.impl.system;
import com.github.pagehelper.PageInfo;
import com.stars.entity.system.SysRedisEntity;
import com.stars.services.system.SysRedisAccessServices;
import com.stars.dao.mapper.system.SysRedisMapper;
import com.stars.entity.dto.system.SysRedisDTO;

import java.util.List;
import com.stars.entity.ListPage;
import com.github.pagehelper.PageHelper;
import com.stars.services.impl.BaseAccessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: 系统创建的redis 业务逻辑
 * @author dj
 * @date 2019-10-21 22:32:59
 * @version V1.0
 *
 */
@Service
public class SysRedisAccessServicesImpl  extends BaseAccessServiceImpl<SysRedisMapper , SysRedisEntity> implements  SysRedisAccessServices {
    @Autowired
    private SysRedisMapper  sysRedisMapper;


    /**
     * 分页查询
     * @param pageNum 查询参数 起始页，大小。
     * @return
     */
    @Override
    public PageInfo<SysRedisDTO> pageList(Integer pageNum, Integer pageSize, SysRedisDTO dto) throws Exception{
        ListPage<SysRedisDTO> listPage = new ListPage<>(pageNum, pageSize, dto);
        PageHelper.startPage(pageNum, pageSize);
        List<SysRedisDTO> list = sysRedisMapper.pageQuerySysRedis(listPage);
        PageInfo<SysRedisDTO> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
